package com.bitejiuyeke.biteportalservice.homepage.controller;

import com.bitejiuyeke.bitecommondomain.domain.R;
import com.bitejiuyeke.biteportalservice.homepage.domain.dto.PullDataListReqDTO;
import com.bitejiuyeke.biteportalservice.homepage.domain.vo.CityDescVO;
import com.bitejiuyeke.biteportalservice.homepage.domain.vo.PullDataListVO;
import com.bitejiuyeke.biteportalservice.homepage.service.IHomePageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/homepage")
public class HomePageController {
    @Autowired
    private IHomePageService homePageService;

    @GetMapping("/city_desc/get/nologin")
    public R<CityDescVO> getCityDesc(Double lat, Double lon) {
        return R.ok(homePageService.getCityDesc(lat, lon));
    }

    @PostMapping("/pull_list/get/nologin")
    public R<PullDataListVO> getPullData(@Validated @RequestBody PullDataListReqDTO reqDTO){
        return R.ok(homePageService.getPullData(reqDTO));
    }
}